import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import query from '@dfeidao/atom-nodejs/db/query';
import { systemid,productid} from '../../atom/config';
interface Message {
	filter:{
		work_bill_no:string
	}
}
// 根据传入的'工单编号work_bill_no'查<工单work_order>表得到'项目编号project_no',项目名称project_name',
// '资产名称Assetsname','位置place','工单时长working_hours','客户名称cust_name','联系电话contact_number',
// '动态提醒时间Dyremindtime','工单名称work_order_name','工单状态work_order_status','来源类型source_type',
// '责任人Responsible',创建时间create_time','结束时间finish_time','完成时间completion_time','超时时长timeout_period',
// 工单内容job_content','类型名称Typename','责任人Responsible','责任人编号responsible_no','客户满意度cust_sat','客户评价customer_evaluation',
// '客户签名customer_reviews'。
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders){
const { prepare, exec } = query(action_id,session_id,systemid);
prepare('work_order', ['project_no','responsible_no','project_name','assetsname','start_time','place','working_hours','cust_name','contact_number','dyremindtime','work_order_status',
'source_type','responsible','finish_time','timeout_period','cust_sat','responsible_no','customer_evaluation','work_order_type','customer_reviews','create_time','job_content',
'completion_time','typename'], { productid,work_bill_no:message.filter.work_bill_no}, 1, 1, [], []);
const [d1] = await exec();
return{d1};
}
